/*
* FaceCat图形通讯框架(非开源)
* 著作权编号:2015SR229355+2020SR0266727
* 上海卷卷猫信息技术有限公司
*/

package facecat.topin.mine;
import facecat.topin.sock.*;

/**
 * 客户端回调接口
 */
public class ClientSocketListener implements FCSocketListener{    
    /*
    * 回调方法
    * @param socketID 套接字ID
    * @param localSID 本地ID(此处无视)
    * @param str 数据
    * @param len 数据长度
    */
    public void callBack(int socketID, int localSID, byte[] str, int len){
         try{
            //接收客户端信息
            FCBinary br = new FCBinary();
            br.write(str, len);
            int head = br.readInt();
            int requestID = br.readInt();
            int bLen = br.readInt();
            byte[] bytes = new byte[bLen];
            br.readBytes(bytes);
            br.close();
             synchronized(this){
                FCFile.append("C:\\Miao\\b.txt", new Integer(requestID).toString() + "\r\n");
            }
        }catch(Exception ex){
            
        }
    }

    /*
    * 写日志
    * @param socketID 套接字ID
    * @param localSID 本地ID(此处无视)
    * @param state 状态
    * @param len 内容
    */
    public void writeLog(int socketID, int localSID, int state, String log){
        if(state == 0){
            int a = 0;
        }
    }
}
